//
//  Person.m
//  isa
//
//  Created by 崔博 on 2018/7/1.
//  Copyright © 2018年 崔博. All rights reserved.
//
//#define TallMask 1
//#define RichMask 2
//#define HandsomeMask 4

//#define TallMask 0b0000001
//#define RichMask 0b0000010
//#define HandsomeMask 0b0000100

#define TallMask (1<<0)
#define RichMask (1<<1)
#define HandsomeMask (1<<2)

#import "Person.h"
@interface Person()
{
    // 位域
    struct {
        char tall : 1;
        char rich : 1;
        char handsome : 1;
    }
    char _tallRichHasome;
}
@end
@implementation Person
- (instancetype)init
{
    self = [super init];
    if (self) {
        
    }
    return self;
}
- (void)setHansome:(BOOL)hansome
{
//    if (hansome) {
//        _tallRichHasome |= HandsomeMask;
//    }else
//    {
//        _tallRichHasome &= ~HandsomeMask;
//    };
    
}
- (BOOL)hansome
{
    return !!(_tallRichHasome & HandsomeMask);
}
- (void)setRich:(BOOL)rich
{
    
}
- (BOOL)rich
{
    return !!(_tallRichHasome & RichMask);
}
- (void)setTall:(BOOL)tall
{
    
}
- (BOOL)tall
{
    return !!(_tallRichHasome & TallMask);
}
@end
